<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>新增角色</title>
</head>
<body>
<div class="pd-20">
	<form action="<%=path%>/backstage/t_user_role-add" method="post" class="form form-horizontal" id="form-t_user_role-add">
		<input type="hidden" id="id" name="id" value='${t_user_role.role_id}' />
        
        <div class="row cl">
			<label class="form-label col-2">角色名：</label>
            <div class="formControls col-4">
                <input type="text" class="input-text" value="${t_user_role.role_name}" placeholder="" id="" name="role_name" datatype="*" nullmsg="不能为空">
        	</div>
		</div>
		
		<div class="row cl">
			
		  <label class="form-label col-2">是否是站长：</label>
		  <div class="formControls col-6 skin-minimal">
			<div class="radio-box">
			  <input type="radio" name="role_type" id="role_type_1" value="0"  <c:if test='${0==t_user_role.role_type}'>checked="true"</c:if> >
			  <label for="role_type_1">否</label>
			</div>
			<div class="radio-box">
			  <input type="radio"  name="role_type" id="role_type_2"  value="1" <c:if test='${1==t_user_role.role_type}'>checked="true"</c:if> >
			  <label for="role_type_2">是</label>
			</div>
		  </div>

		</div>
        
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>权限列表：</label>
			<div class="formControls col-10 action_item">
					
					<div class="div_module">商品中心</div><div class="div_body">
					<c:forEach items="${actions}" var="action">

								<c:choose>
									<c:when test="${action.module_code == 'goods'}">
										  <div class="div_lable">
										  <input type="checkbox" name="action_list" value="${action.action_id}" <c:if test="${action.is_checked==true}">checked</c:if> />
										  ${action.relevance} </div>&nbsp;&nbsp;&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
									</c:otherwise>
								</c:choose>

					</c:forEach></div>
				   <div class="div_module">用户中心</div><div class="div_body">
				   <c:forEach items="${actions}" var="action">

								<c:choose>
									<c:when test="${action.module_code == 'users'}">
										 <div class="div_lable">
										 <input type="checkbox" name="action_list" value="${action.action_id}" <c:if test="${action.is_checked==true}">checked</c:if> />
										  ${action.relevance} </div>&nbsp;&nbsp;&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
									</c:otherwise>
								</c:choose>

					</c:forEach></div>

				   <div class="div_module">配送中心</div><div class="div_body">
				   <c:forEach items="${actions}" var="action">

								<c:choose>
									<c:when test="${action.module_code == 'shipping'}">
										 <div class="div_lable">
										 <input type="checkbox" name="action_list" value="${action.action_id}" <c:if test="${action.is_checked==true}">checked</c:if> />
										  ${action.relevance} </div>&nbsp;&nbsp;&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
									</c:otherwise>
								</c:choose>

					</c:forEach></div>

				   <div class="div_module">商家中心</div><div class="div_body">
				   <c:forEach items="${actions}" var="action">

								<c:choose>
									<c:when test="${action.module_code == 'shops'}">
										 <div class="div_lable">
										 <input type="checkbox" name="action_list" value="${action.action_id}" <c:if test="${action.is_checked==true}">checked</c:if> />
										 ${action.relevance} </div>&nbsp;&nbsp;&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
									</c:otherwise>
								</c:choose>

					</c:forEach></div>

				   <div class="div_module">营销中心</div><div class="div_body">
				   <c:forEach items="${actions}" var="action">

								<c:choose>
									<c:when test="${action.module_code == 'activitys'}">
										<div class="div_lable">
										 <input type="checkbox" name="action_list" value="${action.action_id}" <c:if test="${action.is_checked==true}">checked</c:if> />
										 ${action.relevance} </div>&nbsp;&nbsp;&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
									</c:otherwise>
								</c:choose>

					</c:forEach></div>


				   <div class="div_module">订单中心</div><div class="div_body">
				   <c:forEach items="${actions}" var="action">

								<c:choose>
									<c:when test="${action.module_code == 'orders'}">
										<div class="div_lable">
										 <input type="checkbox" name="action_list" value="${action.action_id}" <c:if test="${action.is_checked==true}">checked</c:if> />
										 ${action.relevance} </div>&nbsp;&nbsp;&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
									</c:otherwise>
								</c:choose>

					</c:forEach></div>

				   <div class="div_module">管理中心</div><div class="div_body">
				   <c:forEach items="${actions}" var="action">

								<c:choose>
									<c:when test="${action.module_code == 'manage'}">
										<div class="div_lable">
										 <input type="checkbox" name="action_list" value="${action.action_id}" <c:if test="${action.is_checked==true}">checked</c:if> />
										  ${action.relevance} </div>&nbsp;&nbsp;&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
									</c:otherwise>
								</c:choose>

					</c:forEach></div>

				   <div class="div_module">财务中心</div><div class="div_body">
				   <c:forEach items="${actions}" var="action">

								<c:choose>
									<c:when test="${action.module_code == 'account'}">
										 <div class="div_lable">
										 <input type="checkbox" name="action_list" value="${action.action_id}" <c:if test="${action.is_checked==true}">checked</c:if> />
										  ${action.relevance} </div>&nbsp;&nbsp;&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
									</c:otherwise>
								</c:choose>

					</c:forEach></div>

					<div class="div_module">推广中心</div><div class="div_body">
				   <c:forEach items="${actions}" var="action">

								<c:choose>
									<c:when test="${action.module_code == 'tuiguang'}">
										 <div class="div_lable">
										 <input type="checkbox" name="action_list" value="${action.action_id}" <c:if test="${action.is_checked==true}">checked</c:if> />
										  ${action.relevance} </div>&nbsp;&nbsp;&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
									</c:otherwise>
								</c:choose>

					</c:forEach></div>
				
			 </div>
		</div>

		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="t_user_role_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>
</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript">

function t_user_role_save_submit(){
	$("#form-t_user_role-add").Validform({
		tiptype:2,
		ajaxPost:true,
		callback:function(form){
			
			if (form.error == "0000"){//success
				var index = parent.layer.getFrameIndex(window.name);
				parent.$('.btn-refresh').click();
				parent.layer.close(index);	
			}else{
				layer.msg(form.information, {time:1000,icon: 5});  
			}
			
		}
	});
}

$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
});

</script>
</body>
</html>

